<!--create by ���孙景学��� on 2018.3.5-->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="head :: head">
    <meta http-equiv="Content-Type" content="text/html"  charset="UTF-8" />
    <link rel="import" href="../head.html"/>
    <script src='../../static/supermap/libs/SuperMap.Include.js'></script>  <!--引用地图js文件-->
    <script src="../../static/supermap/js/superMap_server.js"></script>


</head>
<body class="nav-md">
<div class="container body">
    <div class="main_container">
        <!--��左树��-->
        <div id="monitor_letree" class="col-md-3 left_col" th:replace="letree :: letree"></div>
        <!-- ͷ头部�� -->
        <div class="top_nav" th:include="header :: top"></div>
        <!--� 内容��-->
        <div class="right_col" role="main">

        </div>
    </div>
</div>
<footer th:include="head :: footer">
    <script type="text/javascript" src="../../static/js/prompt.js" th:src="@{/js/prompt.js}"></script>
</footer>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.3&key=1c0d4ac941c42349e59215ab1fbfb2af&plugin=AMap.Geocoder"></script>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
    $(function () {//默认加载数据的table--(role_list)
        sessionStorage.setItem("userName", [[${empName}]]);
        document.cookie = "userName=[[${empName}]];"
        $.goTo(/*[[@{/eventTurn/toEventList}]]*/"./monitor_list.html");
    });
    function reset() {//重置新增表单为空
        $(':input', '#eventAddForm')
                .not(':button,:submit,:reset')   //将myform表单中input元素type为button、submit、reset、hidden排除
                .val('')  //将input元素的value设为空值
                .removeAttr('checked')
                .removeAttr('checked') // 如果任何radio/checkbox/select inputs有checked or selected 属性，将其移除

    }
    function save() {//根据查询条件，查出数据，重新加载数据的table--(role_list)
        $("#unitCode").removeAttr("disabled");
        $("#unitType").removeAttr("disabled");
        if(unitStatus == 1){
           var unitCode =  $("#unitCode").val();
            if(unitCode != null){
                ajaxSaveEvent();
            }else{
                alert("请填写部件信息！");
                return;
            }
        }else{
            ajaxSaveEvent();
        }
    }

    function backToList() {//返回按键，回到数据的table--(role_list)
        $.goTo(/*[[@{toTimeManage}]]*/"./case_inquiry/control_index.html");
    }

    function regeocoder(lnglatXY){
        var geocoder = new AMap.Geocoder({
            radius: 1000,
            extensions: "all"
        });
        geocoder.getAddress(lnglatXY, function(status, result) {
            if (status === 'complete' && result.info === 'OK') {
//                $("#eventLocation").val(result.regeocode.formattedAddress);
//                $('form')
//                    .data('bootstrapValidator')
//                    .updateStatus('eventLocation', 'NOT_VALIDATED', null)
//                    .validateField('eventLocation');
            }else{
//                alert("解析地址失败！");
            }
        });
    }
    function ajaxSaveEvent(){
        /*[+
      $.ajax({
      url: '/eventData/insertEvent',
      type: 'POST',
      async: false,
      cache: false,
      data: new FormData($('#eventAddForm')[0]),
      processData: false,
      contentType: false,
      success: function (result) {
      if(result!=null){
      $.MsgBox.Alert("提示", "存入成功！");
      $.goTo("toEventSend");
      }else {
      $.MsgBox.Alert("提示", "请检查数据是否正确");
      }
      }
      })
      +]*/
    }
    /*]]>*/
</script>
</body>
</html>